
package edu.tongji.jiaowu.dao.jdbc;
 
import java.util.List;

import edu.tongji.jiaowu.dao.PlanPracticePersonDao;
import com.tongji.quickCRUDQ.define.Row;
import com.tongji.quickCRUDQ.model.CommonBean;
import com.tongji.quickCRUDQ.dao.jdbc.BaseDaoJdbc;

public class PlanPracticePersonDaoJdbc extends BaseDaoJdbc implements PlanPracticePersonDao {
	String tableName="T_PLAN_PRACTICE_PERSON";
	String beanName="planPracticePerson";
	
	public CommonBean createPlanPracticePerson(){
		CommonBean planPracticePersons=this.createBean(tableName,beanName);
                return planPracticePersons;		
	}
	
/*
	public CommonBean findPlanPracticePersons(String refid) {
		CommonBean planPracticePersons=this.createPlanPracticePerson();
		String sql="select * from T_PLAN_PRACTICE_PERSON where refid=?";
		List data=this.getCommonDao().select(sql,new String[]{refid});
		planPracticePersons.addData(data);
                return planPracticePersons;
       }
*/
	public CommonBean findPlanPracticePersonById(String id) {
		CommonBean planPracticePersons=this.createPlanPracticePerson();
		String sql="select * from T_PLAN_PRACTICE_PERSON where id=?";
		List data=this.getCommonDao().select(sql,new String[]{id});
		planPracticePersons.addData(data);
    return planPracticePersons;
  }
  
	public CommonBean findAllPlanPracticePersons() {
		CommonBean planPracticePersons=this.createPlanPracticePerson();
		String sql="select * from T_PLAN_PRACTICE_PERSON ";
		List data=this.getCommonDao().select(sql,new String[]{});
		planPracticePersons.addData(data);
    return planPracticePersons;
  }
	public void insertPlanPracticePerson(CommonBean planPracticePersonBean){
		List data=planPracticePersonBean.getData();
		Row row=this.getRow(tableName);
		this.getCommonDao().templateBatchInsert(row,data,this.getIdGenerator());
	}
	public void updatePlanPracticePerson(CommonBean planPracticePersonBean){
		List data=planPracticePersonBean.getData();
		Row row=this.getRow(tableName);
		this.getCommonDao().templateBatchUpdate(row,data);
	}
}

